﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace DISVotingButton
{
    public class DataBase
    {
        private string server = null;
        private string user = null;
        private string pass = null;
        private string database = null;
        private string dbcon = null;
        private SqlConnection m_cnADONetConnection;
        private SqlDataAdapter Ad_ms_Table;
        private SqlCommandBuilder CmBl_ms_Table;

        public DataBase(string server, string user, string pass, string database)
        {
            this.server = server;
            this.user = user;
            this.pass = pass;
            this.database = database;
            dbcon = "server=" + this.server + ";uid=" + this.user + ";pwd=" + this.pass + ";database=" + this.database;
        }

        public DataBase(string server, string database)
        {
            this.server = server;
            this.database = database;
            dbcon = "server=" + this.server + ";database=" + this.database + ";Trusted_Connection=yes";
        }

        public bool checkConnection()
        {
            bool chk = true;
            try
            {
                m_cnADONetConnection = new SqlConnection(dbcon);
                m_cnADONetConnection.Open();
                m_cnADONetConnection.Close();
            }
            catch (SqlException ex) { chk = false; }
            return chk;
        }

        public DataTable getTable(string sql)
        {
            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand(sql, m_cnADONetConnection);
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public void sqlExecute(string sql)
        {
            m_cnADONetConnection = new SqlConnection(dbcon);
            SqlCommand cmd = new SqlCommand(sql, m_cnADONetConnection);
            try
            {
                m_cnADONetConnection.Open();
                cmd.ExecuteNonQuery();
                m_cnADONetConnection.Close();
            }
            catch (SqlException e)
            {
                Console.WriteLine("Error: {0}", e.Errors[0].Message);
            }

        }

        public DataTable procedureParam2(string name, string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand(name, m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable procedure(string name)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand(name, m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable procedureParam1(string name, string paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand(name, m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss.Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable procedureMeetingInsert(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertMeetingTitle", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable procedureAgendaInsert(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertAgenda", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 5));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 5));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 5));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertAgendaPart(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertAgendaPart", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertAgendaParts(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertAgendaParts", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr10", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr10"].Value = paramss[9].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable procedureAlertStringInsert(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertAlertString", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertDelegateInfoFinal(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertDelegateInfoFinal", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr10", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr10"].Value = paramss[9].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr11", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr11"].Value = paramss[10].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr12", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr12"].Value = paramss[11].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr13", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr13"].Value = paramss[12].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr14", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr14"].Value = paramss[13].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr15", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr15"].Value = paramss[14].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertVoting(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertVoting", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr10", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr10"].Value = paramss[9].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertVotingResult(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertVotingResult", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertVotingName(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertVotingName", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.Int));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = int.Parse(paramss[0]);
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr10", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr10"].Value = paramss[9].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertVotingStory(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertVotingStory", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }


        public DataTable insertConclusionVoting(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertConclusionVoting", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr10", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr10"].Value = paramss[9].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr11", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr11"].Value = paramss[10].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr12", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr12"].Value = paramss[11].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr13", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr13"].Value = paramss[12].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr14", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr14"].Value = paramss[13].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr15", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr15"].Value = paramss[14].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr16", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr16"].Value = paramss[15].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr17", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr17"].Value = paramss[16].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr18", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr18"].Value = paramss[17].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr19", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr19"].Value = paramss[18].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr20", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr20"].Value = paramss[19].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr21", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr21"].Value = paramss[20].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr22", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr22"].Value = paramss[21].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr23", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr23"].Value = paramss[22].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr24", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr24"].Value = paramss[23].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr25", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr25"].Value = paramss[24].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr26", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr26"].Value = paramss[25].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr27", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr27"].Value = paramss[26].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr28", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr28"].Value = paramss[27].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr29", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr29"].Value = paramss[28].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr30", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr30"].Value = paramss[29].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr31", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr31"].Value = paramss[30].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertSpeakerList(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertSpeakerList", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr6", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr6"].Value = paramss[5].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr7", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr7"].Value = paramss[6].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr8", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr8"].Value = paramss[7].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr9", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr9"].Value = paramss[8].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr10", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr10"].Value = paramss[9].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr11", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr11"].Value = paramss[10].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr12", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr12"].Value = paramss[11].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr13", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr13"].Value = paramss[12].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr14", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr14"].Value = paramss[13].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr15", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr15"].Value = paramss[14].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr16", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr16"].Value = paramss[15].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr17", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr17"].Value = paramss[16].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr18", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr18"].Value = paramss[17].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertSpeakersStory(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertSpeakersStory", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr5", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr5"].Value = paramss[4].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }


        public DataTable insertStoryTemp(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertStoryTemp", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertSpeakersStop(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertSpeakersStop", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable insertXMLinfo(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("insertXMLinfo", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable updateXMLinfo(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("updateXMLinfo", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable startMeeting(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("startMeeting", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 50));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 1000));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 10));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 20));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }

        public DataTable stopMeeting(string[] paramss)
        {

            DataTable Tb_Table = new DataTable();
            m_cnADONetConnection = new SqlConnection(dbcon);
            Ad_ms_Table = new SqlDataAdapter();
            CmBl_ms_Table = new SqlCommandBuilder(Ad_ms_Table);
            Tb_Table = new DataTable();
            Ad_ms_Table.SelectCommand = new SqlCommand("stopMeeting", m_cnADONetConnection);
            Ad_ms_Table.SelectCommand.CommandType = CommandType.StoredProcedure;
            Ad_ms_Table.SelectCommand.Parameters.Clear();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr1", SqlDbType.VarChar, 50));
            Ad_ms_Table.SelectCommand.Parameters["@pr1"].Value = paramss[0].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr2", SqlDbType.VarChar, 255));
            Ad_ms_Table.SelectCommand.Parameters["@pr2"].Value = paramss[1].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr3", SqlDbType.VarChar, 255));
            Ad_ms_Table.SelectCommand.Parameters["@pr3"].Value = paramss[2].Trim();
            Ad_ms_Table.SelectCommand.Parameters.Add(new SqlParameter("@pr4", SqlDbType.VarChar, 100));
            Ad_ms_Table.SelectCommand.Parameters["@pr4"].Value = paramss[3].Trim();
            m_cnADONetConnection.Open();
            Tb_Table.Clear();
            Ad_ms_Table.Fill(Tb_Table);
            m_cnADONetConnection.Close();
            return Tb_Table;
        }


    }
}
